﻿using System;
using Jayden.Dll.Web.Enums;
using Jayden.Dll.Web.HtmlControls.Descriptions;
using Jayden.Dll.Web.HtmlControls.Generics;
using Jayden.Dll.Web.HtmlControls.Interfaces;

namespace Jayden.Dll.Web.HtmlControls
{
	public class Canvas : HtmlElement, WithHeight, WithWidth
	{
		public Canvas() : base(CanvasDescription.Instance) { }

		public uint? Width { get { return GetAttributeUint("width"); } set { SetAttribute("width", value); } }
		public uint? Height { get { return GetAttributeUint("height"); } set { SetAttribute("height", value); } }
	}
	public class CanvasDescription : HtmlElementDescription
	{
		public static readonly CanvasDescription Instance = new CanvasDescription();
		private CanvasDescription() : base("canvas", HtmlVersion.Html5, true, false) { }
		public override Type ControlType { get { return typeof(Canvas); } }
		public override bool IsPhrasingElement { get { return true; } }
		public override string Description { get { return "resolution-dependent bitmap canvas, which can be used for dynamically rendering of images such as game graphics, graphs, or other images."; } }
	}
}
